Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.

Conversation

@atomicules
Copy link

On NetBSD we can take advantage of Linux Emulation so we have the procfs
mounted and simply use what Linux does.

This builds and the tests pass in the scenario.

I haven't yet been able to get the tests to pass by copying the
process_openbsd.go approach. If/when I do I will do that as a separate
branch.

References: https://github.com/dressupgeekout/keybase-client/commit/bccaaf3096a575589bb6ee8194008c34fe1f97c8
References: keybase/client#19061

On NetBSD we can take advantage of Linux Emulation so we have the procfs
mounted and simply use what Linux does.

This builds and the tests pass in the scenario.

I haven't yet been able to get the tests to pass by copying the
process_openbsd.go approach. If/when I do I will do that as a separate
branch.

References: https://github.com/dressupgeekout/keybase-client/commit/bccaaf3096a575589bb6ee8194008c34fe1f97c8
@heronhaye
Copy link

Thanks for putting this PR up. I'm not familiar with netbsd. Is procfs supported by default? Do netbsd users need to install anything special for this to work? And if they don't, what is the effect here, an empty process list result or an error?

@atomicules
Copy link
Author

It's not enabled by default, but I guess you could say is supported by default.

On both my NetBSD systems I've got it enabled.

And if they don't, what is the effect here, an empty process list result or an error?

I'll spin up another NetBSD system that doesn't use it and then see what happens to answer this question.

@atomicules
Copy link
Author

Well... I'm dumb, but in a good way. Procfs is a standard thing on NetBSD (only been using this OS six years, think I would have known this by now). So on NetBSD amd64 at least (probably other ports as well) this PR allows the keybase command line client to run and build properly (i.e. server launches and forks to the background).

Here's what I did, short version:

  1. Spin up a new NetBSD instance on Linode
  2. Built keybase client using this PR
  3. Signed in to Keybase on that new device and ran keybase chat status, etc.

Slightly longer version:

  1. Set up test NetBSD instance on Linode, need a rescue, install and netbsd disk
  2. Rescue mode to grab image and dd to install disk
  3. Boot install disk and install to main disk
  4. Boot netbsd
  5. add dhcpcd="YES" to rc.conf and reboot
  6. Install pkgin
    export PKG_PATH="http://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD/amd64/8.0_2019Q2/All"
    pkg_add -v pkgin
  7. Update /usr/pkg/etc/pkgin/repositories.conf
  8. pkgin update
  9. pkgin install go111 git-base
  10. mkdir /root/go
  11. export GOPATH=/root/go
  12. export PATH="$PATH:$GOPATH/bin
  13. GIT_SSL_NO_VERIFY=true go111 get github.com/keybase/client/go/keybase
  14. will fail so...
  15. cd /root/go/src/github.com/keybase/client
  16. GIT_SSL_NO_VERIFY=true git fetch origin pull/19061/head:netbsd-cli-using-procfs
  17. git checkout netbsd-cli-using-procfs
  18. cd go/keybase
  19. go111 install -tags production
  20. For testing I did create another user and switch to that to run keybase, because keybase would not let me continue being lazy.

fwiw:

[...]
Username:      atomicules
Logged in:     yes

Device:
    name:      temp-netbsd
    ID:        608fbd22bc52b4dab5adebbdca22c018
    status:    active

Session:
    is valid:  yes
    keys:      unlocked

Key status:
    stream:    cached
    secret:    stored
    dev sig:   cached
    dev enc:   cached
    paper sig: not cached
    paper enc: not cached
    prompt:    show
    tsec:      not cached

KBFS:
    status:    not running
    version:
    installed:
    log:       /home/atomicules/.cache/keybase/keybase.kbfs.log
    mount:

Service:
    status:    running
    version:   4.4.0
    log:       /home/atomicules/.cache/keybase/keybase.service.log
    eklog:     /home/atomicules/.cache/keybase/keybase.ek.log

Updater:
    log:       /home/atomicules/.cache/keybase/keybase.updater.log

Platform Information:
    OS:        netbsd
    OS vers:   NetBSD 8.1 amd64-
    Runtime:   go1.11.10
    Arch:      amd64

Client:
    version:   4.4.0

Desktop app:
    status:    not running
    version:
    log:       /home/atomicules/.cache/keybase/Keybase.app.log
[...]

@atomicules
Copy link
Author

That comment should really be on the other PR. Specific to go-ps on a fresh NetBSD amd64 install:

li275-66# GIT_SSL_NO_VERIFY=true go111 get github.com/keybase/go-ps
li275-66# cd /root/go/src/github.com/keybase/go-ps/
li275-66# GIT_SSL_NO_VERIFY=true git fetch origin pull/10/head:netbsd-using-procfs
remote: Enumerating objects: 4, done.
remote: Counting objects: 100% (4/4), done.
remote: Total 4 (delta 3), reused 4 (delta 3), pack-reused 0
Unpacking objects: 100% (4/4), done.
From https://github.com/keybase/go-ps
 * [new ref]         refs/pull/10/head -> netbsd-using-procfs
li275-66# git checkout  netbsd-using-procfs
Switched to branch 'netbsd-using-procfs'
li275-66# GIT_SSL_NO_VERIFY=true go111 get github.com/stretchr/testify
li275-66# GIT_SSL_NO_VERIFY=true go111 get -insecure gopkg.in/yaml.v2
li275-66# go111 test
PASS
ok      github.com/keybase/go-ps        0.011s

(Sequences maybe shortened/dumb mistakes removed)

@atomicules
Copy link
Author

fwiw (will mention here because it fits in with the above) I cross built a NetBSD arm version from my amd64 box, uploaded that to a NetBSD arm box and was able to run keybase client there as well. I.e. could login, chat ls, etc.

@heronhaye
Copy link

Awesome, thanks for checking it out!

@heronhaye
Copy link

I wonder if we'll need to revisit this for the other BSDs, but we can punt that for now.

@heronhaye heronhaye merged commit 91aafc9 into keybase:master Aug 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants